
/**
 * create by Alec
 */
import React, { Component } from "react";
import PropTypes from "prop-types";

import { Icon } from "@ali/ding-ui";

import "./index.less"

class CardHeader extends Component {
    constructor(props) {
        super(props);
    }

    static defaultProps = {
        title: '',
    };

    static propTypes = {
        title: PropTypes.string, // 左侧标题
        color: PropTypes.string, // 颜色
        link: PropTypes.string, // 预留右侧跳转
    };
    render() {
        const { title = '' , color = '', link = '', subtext = '', arrow = '' } = this.props;
        return (
           <div className="card">
                <span className="title">
                    <i className={`header-tip header-tip-${color}`}></i>
                    {title}
                    <span className="title-subtext">{subtext}</span>
                </span>
                <span className="link">
                    {link}
                    {
                        arrow === 'true' &&
                        <Icon type="right" />
                    }
                    
                </span>
           </div>
        )
    }
}


export default CardHeader;
